package org.springblade.modules.alimqtt.listener;

import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.springblade.modules.alimqtt.annotation.AliListener;
import org.springblade.modules.alimqtt.annotation.AliMsgService;
import org.springblade.modules.alimqtt.message.MsgPayload;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

@Component
@AliMsgService
@Slf4j
@ConditionalOnProperty(name ="aliyun.mqtt.enable", havingValue = "true",matchIfMissing = true)
public class AliMsgListener {

    @AliListener(topic = "door/client/+/test")
    public void heartBeat(MsgPayload msgPayload){
        log.info("kkkk心跳消息{}", JSON.toJSONString(msgPayload));
    }
}
